from flask import g
from functools import wraps



def login_required(func):
    @wraps(func)
    def wrapper(*args,**kwargs):
        if g.user_id is not None:
            return func(*args,**kwargs)
        else:
            return ("www")
    return wrapper